#include <QtGui/QApplication>
#include <QTranslator>
#include <QDebug>
#include <QSettings>
#include <QSplashScreen>

#include "gui/mainwindow/mainwindow.h"

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    QPixmap splash(":/icons/splash/splash.png");
    QSplashScreen splashScreen(splash);
    splashScreen.show();

    splashScreen.showMessage(QObject::tr("Loading Translations"));
    // loading translation
    QString locale = QLocale::system().name();
    QTranslator translator;
    translator.load("translation_" + locale);
    a.installTranslator(&translator);

    QCoreApplication::setOrganizationName("WBSoft");
    QCoreApplication::setApplicationName("WUml");


    splashScreen.showMessage(QObject::tr("Loading Mainwindow"));
    MainWindow w;
    w.connect(&a, SIGNAL(lastWindowClosed()), &w, SLOT(quit()));
    w.show();

    splashScreen.finish(&w);

    return a.exec();
}
